<form id="form" class="layui-form" action="{:url()}" method="post">
    <div class="layui-form-item">
        <label class="layui-form-label">名称</label>
        <div class="layui-input-block">
            <input type="text" name="title" value="{$title}" placeholder="请输入" class="layui-input" readonly>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">标识</label>
        <div class="layui-input-block">
            <input type="text" name="flag" value="{$config_flag}" placeholder="请输入" class="layui-input" readonly>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">名称</label>
        <div class="layui-input-block">
            <input type="text" name="from_name" value="{$data['value']['MAIL_FROMNAME']}" placeholder="请输入" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">服务器host</label>
        <div class="layui-input-block">
            <input type="text" name="host" value="{$data['value']['MAIL_HOST']}" placeholder="请输入" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">服务器port</label>
        <div class="layui-input-block">
            <input type="text" name="port" value="{$data['value']['MAIL_PORT']}" placeholder="465" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">username</label>
        <div class="layui-input-block">
            <input type="text" name="username" value="{$data['value']['MAIL_USERNAME']}" placeholder="请输入" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">password</label>
        <div class="layui-input-block">
            <input type="text" name="password" value="{$data['value']['MAIL_PASSWORD']}" placeholder="请输入" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="button" class="layui-btn submitForm" formId="form">提交</button>
        </div>
    </div>
</form>

<script type="text/javascript">
    $(function(){

        $('.submitForm').click(function (evt) {
            formPost(evt, $(this), function (res) {
                ybLayer.msg(res.msg,{icon: 6});
                setTimeout(function () {
                    location.reload();
                }, 1000);
            }, function (res) {
                ybLayer.msg(res.msg, {icon: 5});
            });
            return false;
        });
    })
</script>